/*
 * Package il.ac.biu.cs.grossmm.api.data
 * File Property.java
 * 
 * This is a part of presence service framework API. 
 * See javadoc for more information.
 *  
 * Copyright (C) 2006 Grossmann Mark
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
 * MA  02110-1301, USA.
 */

package il.ac.biu.cs.grossmm.api.data;

/**
 * Represents a property in a data node.
 * 
 * @param <N>
 *            Node type interface which defines type of node containing this
 *            property
 * @param <V>
 *            class of values which can be stored in this property
 * 
 * @see NodesetByInterface
 * @see NodeTypeByInterface#property(Class, Class)
 * 
 * @author Mark Grossmann
 */
public interface Property<N, V> {

	/**
	 * Gets Class object for a class of values which can be stored in this
	 * property
	 * 
	 * @return Class object for a class of values which can be stored in this
	 *         property
	 */
	public Class<V> getValueClass();

	/**
	 * Gets index of this property in list of all properties of the node type
	 * which contains this property
	 * 
	 * @return the index of this property in list of all properties of the node
	 *         type which contains this property
	 */
	public int index();

	/**
	 * Queries if property must have a unique value across all sibling nodes
	 * 
	 * @return true iff property must have a unique value across all sibling
	 *         nodes
	 */
	public boolean isUnique();

	/**
	 * Gets node type which contains this property
	 * 
	 * @return the node type which contains this property
	 */
	public NodeType<N> getParentNodeType();
}
